package cn.bgs.service.impl;

import cn.bgs.dao.ClassroomMapper;
import cn.bgs.pojo.Classroom;
import cn.bgs.service.ClassroomService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassroomServiceImpl implements ClassroomService {
    @Autowired private ClassroomMapper classroomMapper;


    @Override
    public PageInfo<Classroom> findAllClassroom(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);

        List<Classroom> www=classroomMapper.findAllClassroom();

        PageInfo<Classroom> list= new PageInfo<>(www);


        return list;
    }


    @Override
    public void deleteClassroom(Integer pkId) {
        classroomMapper.deleteClassroom(pkId);
    }

    @Override
    public Classroom selectByPrimaryKey(Integer pkId) {
        return classroomMapper.selectByPrimaryKey(pkId);
    }

    @Override
    public int updateByPrimaryKeySelective(Classroom record) {
        return classroomMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int insertSelective(Classroom record) {
        return classroomMapper.insertSelective(record);
    }


}
